<?php

/**
 *  应用程序入口文件，请勿修改
 */

use Lib\App;

date_default_timezone_set("PRC");

define('APP_PATH', __DIR__);
define('OSS_SWOOLE_PHP7LIB', "/data/app/ieod-web/php7/oss_swoole");
define('OSS_NOT_SWOOLE', '1');

if (strpos(APP_PATH, '/data/website/api7web/htdocs/studio') !== false || (strpos(APP_PATH, '/data/website/apps7web/htdocs') !== false && strpos(APP_PATH, '/data/website/apps7web/htdocs/ulink') === false) || (strpos(APP_PATH, '/data/website/home/htdocs') !== false && strpos(APP_PATH, '/data/website/home/htdocs/ulink') === false)) {
    define('RUN_ENV', 'internal');
} else {
    ini_set('display_errors', 'On');
    error_reporting(E_ALL ^ E_NOTICE);

    define('RUN_ENV', 'ulink');
    define('CONFIG_PATH', '/data/website/configweb/cfg/ulink/config');
}

require APP_PATH . DIRECTORY_SEPARATOR . 'Config' . DIRECTORY_SEPARATOR . RUN_ENV . '.inc.php';

if (defined('ENV') && ENV == 'test') {
    define('NTX_PATH', APP_PATH);
} else {
    define('NTX_PATH', '/data/website/apps7web/htdocs/ntxframework');
    require_once OSS_SWOOLE_PHP7LIB . '/OssDefines.inc.php';
}

define('NTX_LIB', NTX_PATH . DIRECTORY_SEPARATOR . 'Lib');

require_once NTX_LIB . DIRECTORY_SEPARATOR . 'Config' . DIRECTORY_SEPARATOR . 'config.php';
require_once NTX_LIB . DIRECTORY_SEPARATOR . 'Config' . DIRECTORY_SEPARATOR . 'global.php';

require NTX_LIB . DIRECTORY_SEPARATOR . 'Loader.php';

Loader::register();

App::run();

